extends Node2D
@onready var apple = $apple
@onready var collected = $collected


func _on_area_2d_body_entered(body):
	apple.hide()
	collected.show()
	collected.play("collected")
	await collected.animation_finished
	if body and is_instance_valid(body):
		body.collect()
	queue_free()
